<!DOCTYPE html>
<!--招聘管理 -->
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../../css/main.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>招聘管理</legend>
</fieldset>
<div class="layui-row">
    <form class="layui-form ok-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">企业名称:</label>
                <div class="layui-input-inline">
                    <input type="text" name="username" placeholder="请输入关键字" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">时间</label>
                <div class="layui-input-inline">
                    <select name="quiz">
                        <option value="">全部</option>
                        <optgroup>
                            <option value="最近一个月">最近一个月</option>
                            <option value="最近三个月">最近三个月</option>
                            <option value="最近半年">最近半年</option>
                            <option value="最近一年">最近一年</option>
                        </optgroup>
                    </select>
                </div>
            </div>
            <button class="layui-btn" lay-submit="" lay-filter="search" style="margin-bottom:5px;">
                <i class="layui-icon layui-icon-search"></i>
            </button>
        </div>
    </form>
</div>

<table class="layui-hide" id="test"></table>

<script type="text/html" id="switchTpl">
    <!-- 这里的 checked 的状态只是演示 -->
    <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-text="女|男" lay-filter="sexDemo" {{ d.id==
           10003 ? 'checked' : '' }}>
</script>

<script type="text/html" id="checkboxTpl">
    <!-- 这里的 checked 的状态只是演示 -->
    <input type="checkbox" name="lock" value="{{d.id}}" title="锁定" lay-filter="lockDemo" {{ d.id== 10006
           ? 'checked' : '' }}>
</script>


<script src="../../lib/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

<script>
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;

        table.render({
            elem: '#test'
            , url: '/demo/table/user/'
            , cellMinWidth: 80
            , cols: [[
                {type: 'numbers'}
                , {type: 'checkbox'}
                , {field: 'id', title: 'ID', unresize: true,}
                , {field: 'username', title: '岗位名称', templet: '#usernameTpl'}
                , {field: 'city', title: '发布企业'}
                , {field: 'wealth', title: '发布时间'}
                , {field: 'lock', title: '企业详情', templet: '#checkboxTpl', unresize: true}
                , {field: 'lock', title: '操作', templet: '#checkboxTpl', unresize: true}
            ]]
            , page: true
        });

        //监听性别操作
        form.on('switch(sexDemo)', function (obj) {
            layer.tips(this.value + ' ' + this.name + '：' + obj.elem.checked, obj.othis);
        });

        //监听锁定操作
        form.on('checkbox(lockDemo)', function (obj) {
            layer.tips(this.value + ' ' + this.name + '：' + obj.elem.checked, obj.othis);
        });
    });
</script>

</body>
</html>